﻿/****************************************************************************
Copyright (c) 2014-2015 凌惊雪 微信:Lingjingxue 邮箱:lingjingxue@sina.com QQ:271487457

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
****************************************************************************/

using ServerBase.Protocol;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.Text;
using System.Threading.Tasks;
using UtilLib;
using ServerBase.Config;
using ServerPublic.Manager;
using static ServerBase.Config.Conf;
using ServerPublic.Data;

namespace ServerGame.GameObject
{
    [Desc("邮件数据")]
    [DataContract]
    public class Mail
    {
        [Desc("唯一ID")]
        [DataMember]
        public long Uid;
        [Desc("邮件类型")]
        [DataMember]
        public EMailType MailType;
        [Desc("邮件标题")]
        [DataMember]
        public string Title = "邮件";
        [Desc("邮件正文")]
        [DataMember]
        public string Body = "";
        [Desc("发件人名字")]
        [DataMember]
        public string SenderName = "发件人";
        [Desc("邮件创建时间")]
        [DataMember]
        public DateTime CreateTime = DateTime.Now;
        [Desc("已读")]
        [DataMember]
        public bool Readed = false;
        [Desc("已领")]
        [DataMember]
        public bool Got = false;
        [Desc("保存")]
        [DataMember]
        public bool Saved = false;
        [Desc("已发邮件")]
        [DataMember]
        public bool Sended = false;
        [Desc("(已发邮件生效 个人邮件：收件人名字 国家邮件：对象名)")]
        [DataMember]
        public string ReceiveName = "收件人";
        [Desc("邮件附件来源")]
        [DataMember]
        public EActionSource ActionSource = EActionSource.邮件;
        [Desc("邮件附件")]
        [DataMember]
        public List<CLS_AwardItem> Attachments = new List<CLS_AwardItem>();
        [Desc("false=注册时间在发送邮件之前的才能收到全服邮件 true=无论是否在发邮件之前注册都能收到")]
        [DataMember]
        public bool AllTimeReceive = false;

        
        //是否有附件
        public bool HasAttachments => (Attachments.Count > 0);
        
        

        
        
        
        
    }

}
